package day06;

public class Lee {
    public static void main(String[] args) {
        int[] a = {6,16,26,66,56 };
        int max =getMaxOfArray(a);
        System.out.println(max);

        int[] b =new int[10];
        for (int i =0;i<b.length;i++){
            b[i] =(int)(Math.random()*100);
        }
        int maxx = getMaxOfArray(b);
        System.out.println(maxx);
    }
    public static int getMaxOfArray(int[] arr){
        int max = arr[0];
        for (int i = 1;i<arr.length;i++){
            if (max < arr[i]){
                max = arr[i];
            }

        }
        return max;
    }
}
